﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Altairis.FluffyCloud.Data {
    public class Message {

        [Key]
        public Guid MessageId { get; set; }

        [Required]
        public string FromUserName { get; set; }
        public virtual User FromUser { get; set; }

        [Required]
        public string ToUserName { get; set; }
        public virtual User ToUser { get; set; }

        [Required]
        public DateTimeOffset DateCreated { get; set; }

        public DateTimeOffset? DateRead { get; set; }

        [MaxLength(39)]
        public string IpAddress { get; set; }

        [DataType("WikiMarkup")]
        public string Text { get; set; }

        public Message() {
            this.MessageId = Guid.NewGuid();
            this.DateCreated = DateTimeOffset.UtcNow;
        }

    }
}
